package com.gz.logistics.library.pojo;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * author wanner1991
 */
public class Money implements Serializable {
    private String receiveType;//支付方式
    private String money;//应收金额

    public String getReal_money() {
        return real_money;
    }

    public void setReal_money(String real_money) {
        this.real_money = real_money;
    }

    public String getReceiveType() {
        return receiveType;
    }

    public void setReceiveType(String receiveType) {
        this.receiveType = receiveType;
    }

    public String getMoney() {
        return money;
    }

    public void setMoney(String money) {
        this.money = money;
    }

    private String real_money;//实收金额

    public static List<Money> parse(JSONArray jsonArray) throws JSONException {
        if (jsonArray == null || jsonArray.length() <= 0){
            return null;
        }
        List<Money> moneyinfo = new ArrayList<Money>();
        for (int i = 0 ; i < jsonArray.length() ; i++ ){
            Money info = new Money();
            JSONObject object = jsonArray.getJSONObject(i);
            info.receiveType = object.getString("receive_type");
            info.money = object.getString("money");
            info.real_money = object.getString("real_money");
            moneyinfo.add(info);

        }
        return moneyinfo;
    }
}
